home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / lex / Syntax.sml < prev   
Encoding:
Text File  |  1997-08-18  |  656 b   |  31 lines  |  [TEXT/R*ch]

  1. (* The shallow abstract syntax *)
  2.  
  3. datatype location =
  4.     Location of int * int
  5. ;
  6.  
  7. datatype regular_expression =
  8.     Epsilon
  9.   | Characters of char list
  10.   | Sequence of regular_expression * regular_expression
  11.   | Alternative of regular_expression * regular_expression
  12.   | Repetition of regular_expression
  13. ;
  14.  
  15. datatype lexer_definition =
  16.     Lexdef of location * (string * (regular_expression * location) list) list
  17. ;
  18.  
  19. (* Representation of automata *)
  20.  
  21. datatype automata =
  22.     Perform of int
  23.   | Shift of automata_trans * automata_move Array.array
  24. and automata_trans =
  25.     No_remember
  26.   | Remember of int
  27. and automata_move =
  28.     Backtrack
  29.   | Goto of int
  30. ;
  31.